﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the Microsoft Public License (Ms-PL).
// See accompanying file License.txt or copy at http://mews.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Mews.Net.Nntp.Cache
{
    using System;

    /// <summary>Exposes the methods supported by persistent objects that can be deleted.</summary>
    /// <threadsafety static="true" instance="false"/>
    public interface IDeletablePersistentObject
    {
        /// <summary>Removes from the cache the information represented by this object.</summary>
        /// <exception cref="InvalidOperationException"><list type="bullet">
        /// <item><see cref="Cache.Dispose"/> has been called on the parent <see cref="Cache"/> object, <b>and/or</b>
        /// </item>
        /// <item><see cref="Delete"/> has already been called on this object or any of its parent objects,
        /// <b>and/or</b></item>
        /// <item><see cref="Cache.IsSendReceiveInProgress"/> is currently true on the parent <see cref="Cache"/>
        /// object.</item>
        /// </list></exception>
        /// <remarks>Automatically also removes from the cache all information that has possibly been added with
        /// child objects.</remarks>
        void Delete();
    }
}
